<template>
  <el-tabs type="border-card" v-model="tabs.activeName">
    <el-tab-pane name="first" label="基本信息">
      <LosseventDetailBase :detailDialog.sync="detailDialog" @doRefresh="getList"> </LosseventDetailBase>

      <pocesStart v-if="detailDialog.hasPoces" :detailDialog.sync="detailDialog" @doRefresh="getList"></pocesStart>

    </el-tab-pane>
    <el-tab-pane   v-if="detailDialog.id" name="second" label="明细信息">
      <LossItem :detailDialog.sync="detailDialog"></LossItem>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
  import pocesStart from "@/views/activiti/pocess/pocesStart.vue";
  import LosseventDetailBase from "./LosseventDetailBase.vue";
  import LossItem from "../item/index.vue";
  export default {
    name: "LosseventDetailTabs",
    props: {
      detailDialog: {
        type: Object,
        default: function() {
          return {
            // id
            id: null,
            open: null,
            // 是否详情页
            isDisabled: null,
          }
        },
      },
    },

    components: {
      LosseventDetailBase,
      LossItem,
      pocesStart
    },

  data() {
    return {
        tabs:{
          activeName : "first",
        }

    }
  },

    watch: {
      /* 监听打开状态 */
      "detailDialog.open": function(newOpen, oldOpen) {
        this.tabs.activeName="first"
      },
    },
    methods: {
      getList() {

        this.$emit("doRefresh");
      },

    },
  }
</script>

<style>
</style>
